﻿using Coldairarrow.Entity.DTO;
using Coldairarrow.Entity.PB;
using Coldairarrow.Util;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Coldairarrow.Business.PB
{
    public partial interface IPB_StockBusiness
    {
        Task<PageResult<PB_Stock>> GetDataListAsync(PageInput<ConditionDTO> input);
        Task<PageResult<InventoryDataDTO>> GetInventoryData(PageInput<QueryGetInventoryDTO> input);
        Task<PageResult<InventoryDetalDTO>> GetInventorydetalData(PageInput<QueryGetInventoryDTO> input);
        Task<PB_Stock> GetTheDataAsync(string id);
        Task Warehousing(PB_StockDTOquery query);
        PageResult<ReturnManagementDTO> WarehousingManagement(ManagementQueryDTO queryDTO);
        StockDataInfoDTO GetWarehousingManagement(string ReceiptdocNo);
        Task AddDataAsync(PB_Stock data);
        Task UpdateDataAsync(PB_Stock data);
        Task DeleteDataAsync(List<string> ids);



        /// <summary>
        /// 获取要拆包的成品
        /// </summary>
        /// <param name="JobBookingqrcode">成品二维码</param>
        /// <param name="packqrcode">要拆包的二维码</param>
        /// <returns></returns>
        Task<PackListDetailDTO> GetJobBookingDataAsync(string JobBookingqrcode, string packqrcode);

        /// <summary>
        /// 拆包获取包的信息
        /// </summary>
        /// <param name="packqrcode">包二维码</param>
        /// <returns></returns>
        Task<PB_PackListDTO> GetPackDataAsync(string packqrcode);

        /// <summary>
        /// 拆包提交信息(全局变量为true)
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task<PB_PackListDTO> UnpackingDataAsync(UnpackingDataDTO data);

        /// <summary>
        /// 拆包提交信息(全局变量为false)
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task UnpackingPackDataAsync(UnpackingPackDTO data);

        /// <summary>
        /// 扫描合并包
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task<PB_PackListDTO> GetNewPackDataAsync(UnpackingDataDTO data);

        /// <summary>
        /// 合并提交信息
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task<PB_PackListDTO> MergeUnpackingDataAsync(UnpackingDataDTO data);

        #region  SKU管理合并包

        /// <summary>
        /// 合并包扫描成品物料信息
        /// </summary>
        /// <param name="JobQrCode">成品二维码</param>
        /// <returns></returns>
        Task<PackListDetailDTO> GetMergePackListDetailDataAsync(string JobQrCode);

        /// <summary>
        /// 合并包保存
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task SaveMergePackListDetailAsync(MergePackListDetail data);

        #endregion

        #region  移库

        /// <summary>
        /// 移库操作
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task TransferLibraryDataAsync(TransferLibraryDTO data);

        /// <summary>
        /// 获取库里的包信息
        /// </summary>
        /// <param name="packqrcode">包二维码</param>
        /// <param name="LocalQrCode">货位二维码</param>
        /// <returns></returns>
        Task<MovePackListDTO> GetStockPackDataAsync(string packqrcode, string LocalQrCode);

        /// <summary>
        /// 获取单个物料信息
        /// </summary>
        /// <param name="MaterialQrCode">物料二维码</param>
        /// <param name="LocalQrCode">货位二维码</param>
        /// <returns></returns>
        Task<MovePackListDTO> GetMoveMaterialDataAsync(string MaterialQrCode, string LocalQrCode);

        /// <summary>
        /// 获取单个成品物料信息
        /// </summary>
        /// <param name="JobQrCode">成品二维码</param>
        /// <param name="LocalQrCode">货位二维码</param>
        /// <returns></returns>
        Task<MovePackListDTO> GetMoveJobDataAsync(string JobQrCode, string LocalQrCode);

        #endregion

    }

    #region  SKU管理合并包DTO

    public class MergePackListDetail
    {

        /// <summary>
        /// 合并包二维码
        /// </summary>
        public string PackQrCode { get; set; }

        /// <summary>
        /// 合并的成品明细
        /// </summary>
        public List<PackListDetailDTO> PackListDetail { get; set; }

    }

    #endregion

}